package com.qing.demo.netty.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

/**
 * @author caozhipeng
 * @date 2025/8/7
 */
@Service
public class Publisher {

    private final RedisTemplate<String,Object> redisTemplate;

    @Autowired
    public Publisher(RedisTemplate<String, Object> redisTemplate) {
        this.redisTemplate = redisTemplate;
    }

    public void pushMessage(String channel,Object message){
        redisTemplate.convertAndSend(channel,message);
    }


}
